package cn.lanqiao.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.lanqiao.entity.Fill_question;
import cn.lanqiao.service.Fill_questionService;
/**
 * 填空模块
 * @author yejun
 */
@Service
public class Fill_questionServiceImpl implements Fill_questionService {

	@Autowired
	private cn.lanqiao.mapper.Fill_questionMapper fill_questionMapper;

	//展示所有数据
	@Override
	public List<Fill_question> getAllFill() {
		return fill_questionMapper.listAllFill();
	}
	
	//查看详情
	@Override
	public List<Fill_question> getFillById(Integer paperId) {
		return fill_questionMapper.getFill(paperId);
	}
	
	//删除
	@Override
	public int deleteFill(Integer paperId) {
		return fill_questionMapper.delete(paperId);
	}

	//添加
	@Override
	public int insertFill(Fill_question fill) {
		return fill_questionMapper.insert(fill);
	}
	@Override
	public int deleteFillByID(Integer questionId) {
		return fill_questionMapper.deleteID(questionId);
	}
	//更新
	@Override
	public int updateFill(Fill_question fill) {
		return fill_questionMapper.update(fill);
	}
	//分页
//	@Override
//	public Pages<Paper_manage> PaperPage(int indexPage, int pageSize, String searchkey) {
//		Pages<Paper_manage> page = new Pages<Paper_manage>();
//		//当前页面indexPage
//		page.setIndexPage(indexPage);
//		//总记录数totalData
//		int totalData = paper_manageMapper.count(searchkey);
//		page.setTotalData(totalData);
//		//当前页面记录数pageSize;
//		page.setPageSize(pageSize);
//		//总页数totalPages
//		int totalPages = totalData % pageSize ==0 ? totalData / pageSize : totalData/ pageSize + 1;
//		page.setTotalPages(totalPages);
//		
//		Map<String,Object> map = new HashMap<String,Object>();
//		int startindex = (indexPage -1) * pageSize;
//		int endindex = pageSize;
//		
//		map.put("startindex", startindex);
//		map.put("endindex", endindex);
//		map.put("searchkey", searchkey);
//		
//		List<Paper_manage> data = paper_manageMapper.PaperPages(map);
//		page.setPageData(data);
//		
//		return page;
//	}
	
	//修改
//	@Override
//	public int updateStudent(Student student) {
//		return studentMapper.update(student);
//	}
	

	
}
